/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aprendizajePorRefuerzo.estado;

/**
 *
 * @author Fernando Sorzana
 */
public class EstadoGrilla implements Estado{
    
    private boolean esFinal;
    
    private boolean esTransitable;
    
    private int fila;
    
    private int columna;

    public EstadoGrilla(boolean esFinal, boolean esTransitable, int fila, int columna) {
        this.esFinal = esFinal;
        this.esTransitable = esTransitable;
        this.fila = fila;
        this.columna = columna;
    }

    @Override
    public boolean esFinal() {
        return esFinal;
    }

    public void setFinal(boolean esFinal) {
        this.esFinal = esFinal;
    }

    public boolean esTransitable() {
        return esTransitable;
    }

    public void setTransitable(boolean esTransitable) {
        this.esTransitable = esTransitable;
    }

    public int getFila() {
        return fila;
    }

    public void setFila(int fila) {
        this.fila = fila;
    }

    public int getColumna() {
        return columna;
    }

    public void setColumna(int columna) {
        this.columna = columna;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 41 * hash + this.fila;
        hash = 41 * hash + this.columna;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final EstadoGrilla other = (EstadoGrilla) obj;
        if (this.fila != other.fila) {
            return false;
        }
        if (this.columna != other.columna) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "(" + fila + "," + columna + ")";
    }
    
}
